{extend name='common/common' /}

{block name="style"}
<link href="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet">
<style>
    .ibox-content{
        padding: 0px 0px;
    }
    .layui-tab{
        margin: 0px;
    }
</style>
{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-10">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>资料客户信息录入</h5>
                </div>
                <div class="ibox-content">
					<form class="form-horizontal m-t" id="commentForm" method="post" action="{:url('Member/addResMember')}">
						<div class="form-group">
							<label class="col-sm-3 control-label">姓名&nbsp;*：</label>
							<div class="input-group col-sm-7">
								<input id="name" type="text" class="form-control" name="name" required="" aria-required="true">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">联系电话&nbsp;*：</label>
							<div class="input-group col-sm-7">
								<input id="phone" type="text" class="form-control" name="phone" required="" aria-required="true">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">QQ：</label>
							<div class="input-group col-sm-7">
								<input id="qq" class="form-control" name="qq">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">微信：</label>
							<div class="input-group col-sm-7">
								<input id="weixin" class="form-control" name="weixin">
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">地址：</label>
							<div class="input-group col-sm-7">
								<input id="adress" type="text" class="form-control" name="adress" required="" aria-required="true" value="">
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">民族：</label>
							<div class="input-group col-sm-7">
								<input id="nation" type="text" class="form-control" name="nation" required="" aria-required="true" value="">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">身份证号：</label>
							<div class="input-group col-sm-7">
								<input id="id_card" type="text" class="form-control" name="id_card" required="" aria-required="true" value="">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">生日：</label>
							<div class="input-group col-sm-7">
								<input id="birthday" type="text" class="form-control" name="birthday" required="" aria-required="true" value="">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">性别：</label>
							<div class="input-group col-sm-7">
								<select name="sex" id="sex" class="form-control" >
									<option value="1">男</option>
									<option value="2">女</option>
								</select>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label">备注：</label>
							<div class="input-group col-sm-7">
								<input id="remarks" class="form-control" name="remarks">
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-6 col-sm-offset-6" style="padding-left: 6%">
								<button class="btn btn-primary" type="submit" style="margin-right: 25px">确认提交</button>
								<a href="javascript:;" onclick="javascript :history.back(-1);">
									<button type="button" class="btn btn-primary btn-sm" style="width: 82px;height: 34px;">
										返回
									</button>
								</a>
							</div>
						</div>
					</form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/content.min.js?v=1.0.0"></script>
<script src="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script type="text/javascript">
    var index = '';
    function showStart(){
        index = layer.load(0, {shade: false});
        return true;
    }
    function showSuccess(res){
        layer.ready(function(){
            layer.close(index);
            if(1 == res.code){
                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
                    window.location.href = res.data;
                });
            }else if(111 == res.code){
                window.location.reload();
            }else{
                layer.msg(res.msg, {anim: 6});
            }
        });
    }
    $(document).ready(function(){
        // 添加角色
        var options = {
            beforeSubmit:showStart,
            success:showSuccess
        };
        $('#commentForm').submit(function(){
            $(this).ajaxSubmit(options);
            return false;
        });
    });
</script>


<script>
	layui.use('laydate', function() {
        var laydate = layui.laydate;
		laydate.render({
			elem: '#birthday',
			type: 'date'
		});
    })
</script>
{/block}
